/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 21 2009)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "MuRo_Frames.h"

///////////////////////////////////////////////////////////////////////////

MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxSize( 400,300 ), wxDefaultSize );
	
	menubar = new wxMenuBar( 0 );
	menu_File = new wxMenu();
	wxMenuItem* menuItem_Load;
	menuItem_Load = new wxMenuItem( menu_File, wxID_ANY, wxString( wxT("Load configuration...") ) , wxEmptyString, wxITEM_NORMAL );
	menu_File->Append( menuItem_Load );
	
	wxMenuItem* menuItem_Save;
	menuItem_Save = new wxMenuItem( menu_File, wxID_ANY, wxString( wxT("Save configuration...") ) , wxEmptyString, wxITEM_NORMAL );
	menu_File->Append( menuItem_Save );
	
	wxMenuItem* menuItem_Settings;
	menuItem_Settings = new wxMenuItem( menu_File, wxID_ANY, wxString( wxT("Settings...") ) , wxEmptyString, wxITEM_NORMAL );
	menu_File->Append( menuItem_Settings );
	
	wxMenuItem* menuItem_Exit;
	menuItem_Exit = new wxMenuItem( menu_File, wxID_ANY, wxString( wxT("Exit") ) + wxT('\t') + wxT("ALT+F4"), wxEmptyString, wxITEM_NORMAL );
	menu_File->Append( menuItem_Exit );
	
	menubar->Append( menu_File, wxT("File") );
	
	menu_View = new wxMenu();
	wxMenuItem* menuItem_Grid;
	menuItem_Grid = new wxMenuItem( menu_View, wxID_ANY, wxString( wxT("Grid") ) + wxT('\t') + wxT("F5"), wxEmptyString, wxITEM_CHECK );
	menu_View->Append( menuItem_Grid );
	menuItem_Grid->Check( true );
	
	wxMenuItem* menuItem_Follow;
	menuItem_Follow = new wxMenuItem( menu_View, wxID_ANY, wxString( wxT("Follow selected") ) + wxT('\t') + wxT("F6"), wxEmptyString, wxITEM_CHECK );
	menu_View->Append( menuItem_Follow );
	
	wxMenuItem* menuItem_ZoomIn;
	menuItem_ZoomIn = new wxMenuItem( menu_View, wxID_ANY, wxString( wxT("Zoom in") ) + wxT('\t') + wxT("+"), wxEmptyString, wxITEM_NORMAL );
	menu_View->Append( menuItem_ZoomIn );
	
	wxMenuItem* menuItem_ZoomOut;
	menuItem_ZoomOut = new wxMenuItem( menu_View, wxID_ANY, wxString( wxT("Zoom out") ) + wxT('\t') + wxT("-"), wxEmptyString, wxITEM_NORMAL );
	menu_View->Append( menuItem_ZoomOut );
	
	menubar->Append( menu_View, wxT("View") );
	
	menu_Unit = new wxMenu();
	wxMenuItem* menuItem_Position;
	menuItem_Position = new wxMenuItem( menu_Unit, ID_MENUITEM_SET_POSITION, wxString( wxT("Set position") ) + wxT('\t') + wxT("F9"), wxEmptyString, wxITEM_NORMAL );
	menu_Unit->Append( menuItem_Position );
	
	wxMenuItem* m_separator1;
	m_separator1 = menu_Unit->AppendSeparator();
	
	wxMenuItem* menuItem_Observation;
	menuItem_Observation = new wxMenuItem( menu_Unit, ID_MENUITEM_OBSERVATION, wxString( wxT("Observation mode") ) + wxT('\t') + wxT("F10"), wxEmptyString, wxITEM_RADIO );
	menu_Unit->Append( menuItem_Observation );
	
	wxMenuItem* menuItem_Manual;
	menuItem_Manual = new wxMenuItem( menu_Unit, ID_MENUITEM_MANUAL, wxString( wxT("Manual drive") ) + wxT('\t') + wxT("F11"), wxEmptyString, wxITEM_RADIO );
	menu_Unit->Append( menuItem_Manual );
	
	wxMenuItem* menuItem_CoordDrive;
	menuItem_CoordDrive = new wxMenuItem( menu_Unit, ID_MENUITEM_COORDDRIVE, wxString( wxT("Coordinate drive") ) + wxT('\t') + wxT("F12"), wxEmptyString, wxITEM_RADIO );
	menu_Unit->Append( menuItem_CoordDrive );
	
	wxMenuItem* m_separator2;
	m_separator2 = menu_Unit->AppendSeparator();
	
	wxMenuItem* menuItem_PositionHistory;
	menuItem_PositionHistory = new wxMenuItem( menu_Unit, ID_MENUITEM_POSITION_HISTORY, wxString( wxT("Position history") ) , wxEmptyString, wxITEM_CHECK );
	menu_Unit->Append( menuItem_PositionHistory );
	
	wxMenuItem* menuItem_RangingHistory;
	menuItem_RangingHistory = new wxMenuItem( menu_Unit, ID_MENUITEM_RANGING_HISTORY, wxString( wxT("Ranging history") ) , wxEmptyString, wxITEM_CHECK );
	menu_Unit->Append( menuItem_RangingHistory );
	
	menubar->Append( menu_Unit, wxT("Unit") );
	
	menu_Help = new wxMenu();
	wxMenuItem* menuItem_Help;
	menuItem_Help = new wxMenuItem( menu_Help, wxID_ANY, wxString( wxT("Help") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL );
	menu_Help->Append( menuItem_Help );
	
	menubar->Append( menu_Help, wxT("Help") );
	
	settings = new wxMenu();
	wxMenuItem* speedctrlSettings;
	speedctrlSettings = new wxMenuItem( settings, ID_SPEEDCTRL_SETTINGS, wxString( wxT("SpeedCtrl Settings") ) , wxEmptyString, wxITEM_NORMAL );
	settings->Append( speedctrlSettings );
	
	menubar->Append( settings, wxT("Settings") );
	
	this->SetMenuBar( menubar );
	
	statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxHORIZONTAL );
	
	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer5;
	bSizer5 = new wxBoxSizer( wxHORIZONTAL );
	
	button_MiniView = new wxButton( this, wxID_ANY, wxT("Hide mini view"), wxDefaultPosition, wxSize( -1,23 ), 0 );
	button_MiniView->Hide();
	
	bSizer5->Add( button_MiniView, 0, wxALL, 5 );
	
	button_Help = new wxButton( this, wxID_ANY, wxT("Help"), wxDefaultPosition, wxSize( -1,23 ), 0 );
	bSizer5->Add( button_Help, 0, wxALL, 5 );
	
	
	bSizer5->Add( 0, 0, 1, wxEXPAND, 5 );
	
	button_Options = new wxButton( this, wxID_ANY, wxT("Hide options"), wxDefaultPosition, wxSize( -1,23 ), 0 );
	bSizer5->Add( button_Options, 0, wxALL, 5 );
	
	bSizer1->Add( bSizer5, 0, wxEXPAND, 5 );
	
	scrolledWindow_MiniScreens = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize( -1,100 ), wxHSCROLL|wxVSCROLL );
	scrolledWindow_MiniScreens->SetScrollRate( 5, 5 );
	scrolledWindow_MiniScreens->SetBackgroundColour( wxColour( 157, 157, 157 ) );
	scrolledWindow_MiniScreens->Hide();
	scrolledWindow_MiniScreens->SetMinSize( wxSize( -1,100 ) );
	
	wxBoxSizer* bSizer11;
	bSizer11 = new wxBoxSizer( wxVERTICAL );
	
	m_panel1 = new wxPanel( scrolledWindow_MiniScreens, wxID_ANY, wxDefaultPosition, wxSize( 125,100 ), wxTAB_TRAVERSAL );
	m_panel1->SetMinSize( wxSize( 125,100 ) );
	
	wxBoxSizer* bSizer2;
	bSizer2 = new wxBoxSizer( wxHORIZONTAL );
	
	staticText_miniViewStatus = new wxStaticText( m_panel1, wxID_ANY, wxT("No other machines"), wxDefaultPosition, wxDefaultSize, 0 );
	staticText_miniViewStatus->Wrap( -1 );
	bSizer2->Add( staticText_miniViewStatus, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	m_panel1->SetSizer( bSizer2 );
	m_panel1->Layout();
	bSizer11->Add( m_panel1, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxFIXED_MINSIZE, 0 );
	
	scrolledWindow_MiniScreens->SetSizer( bSizer11 );
	scrolledWindow_MiniScreens->Layout();
	bSizer1->Add( scrolledWindow_MiniScreens, 0, wxALL|wxEXPAND|wxFIXED_MINSIZE, 0 );
	
	panel_MainScreen = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	panel_MainScreen->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) );
	
	bSizer1->Add( panel_MainScreen, 1, wxEXPAND | wxALL, 0 );
	
	bSizer7->Add( bSizer1, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer18;
	bSizer18 = new wxBoxSizer( wxVERTICAL );
	
	bSizer18->SetMinSize( wxSize( 200,-1 ) ); 
	panel_Options = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 200,-1 ), wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer71;
	bSizer71 = new wxBoxSizer( wxVERTICAL );
	
	m_staticText20 = new wxStaticText( panel_Options, wxID_ANY, wxT("Machines"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText20->Wrap( -1 );
	m_staticText20->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	
	bSizer71->Add( m_staticText20, 0, wxALL, 5 );
	
	treeCtrl_Groups = new wxTreeCtrl( panel_Options, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE|wxTR_HAS_BUTTONS|wxTR_HIDE_ROOT );
	treeCtrl_Groups->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Sans") ) );
	
	bSizer71->Add( treeCtrl_Groups, 2, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* bSizer61;
	bSizer61 = new wxBoxSizer( wxVERTICAL );
	
	staticText_Status = new wxStaticText( panel_Options, wxID_ANY, wxT("Status:"), wxDefaultPosition, wxDefaultSize, 0 );
	staticText_Status->Wrap( -1 );
	staticText_Status->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	
	bSizer61->Add( staticText_Status, 0, wxALL, 5 );
	
	wxBoxSizer* bSizer10;
	bSizer10 = new wxBoxSizer( wxHORIZONTAL );
	
	m_staticText12 = new wxStaticText( panel_Options, wxID_ANY, wxT("Pose"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText12->Wrap( -1 );
	m_staticText12->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	
	bSizer10->Add( m_staticText12, 0, wxALL, 5 );
	
	staticText_Pose = new wxStaticText( panel_Options, wxID_ANY, wxT("- , - , -"), wxDefaultPosition, wxDefaultSize, 0 );
	staticText_Pose->Wrap( -1 );
	bSizer10->Add( staticText_Pose, 0, wxALL, 5 );
	
	bSizer61->Add( bSizer10, 0, wxEXPAND, 5 );
	
	m_staticText61 = new wxStaticText( panel_Options, wxID_ANY, wxT("Devices:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText61->Wrap( -1 );
	m_staticText61->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	
	bSizer61->Add( m_staticText61, 0, wxALL, 5 );
	
	wxGridSizer* gSizer1;
	gSizer1 = new wxGridSizer( 3, 2, 0, 0 );
	
	m_staticText13 = new wxStaticText( panel_Options, wxID_ANY, wxT("Position"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText13->Wrap( -1 );
	m_staticText13->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	
	gSizer1->Add( m_staticText13, 0, wxALL|wxEXPAND, 5 );
	
	wxArrayString choice_PositionChoices;
	choice_Position = new wxChoice( panel_Options, wxID_ANY, wxDefaultPosition, wxDefaultSize, choice_PositionChoices, 0 );
	choice_Position->SetSelection( 0 );
	choice_Position->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	choice_Position->Enable( false );
	
	gSizer1->Add( choice_Position, 0, wxALL|wxEXPAND, 0 );
	
	m_staticText18 = new wxStaticText( panel_Options, wxID_ANY, wxT("Manual drive"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText18->Wrap( -1 );
	m_staticText18->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	
	gSizer1->Add( m_staticText18, 0, wxALL, 5 );
	
	wxArrayString choice_ManualChoices;
	choice_Manual = new wxChoice( panel_Options, wxID_ANY, wxDefaultPosition, wxDefaultSize, choice_ManualChoices, 0 );
	choice_Manual->SetSelection( 0 );
	choice_Manual->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	choice_Manual->Enable( false );
	
	gSizer1->Add( choice_Manual, 0, wxALL|wxEXPAND, 0 );
	
	m_staticText19 = new wxStaticText( panel_Options, wxID_ANY, wxT("Coord. drive"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText19->Wrap( -1 );
	m_staticText19->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	
	gSizer1->Add( m_staticText19, 0, wxALL, 5 );
	
	wxArrayString choice_CoordDriveChoices;
	choice_CoordDrive = new wxChoice( panel_Options, wxID_ANY, wxDefaultPosition, wxDefaultSize, choice_CoordDriveChoices, 0 );
	choice_CoordDrive->SetSelection( 0 );
	choice_CoordDrive->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) );
	choice_CoordDrive->Enable( false );
	
	gSizer1->Add( choice_CoordDrive, 0, wxALL|wxEXPAND, 0 );
	
	bSizer61->Add( gSizer1, 0, wxEXPAND, 5 );
	
	treeCtrl_Services = new wxTreeCtrl( panel_Options, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE|wxTR_HIDE_ROOT );
	treeCtrl_Services->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Sans") ) );
	
	bSizer61->Add( treeCtrl_Services, 1, wxALL|wxEXPAND, 5 );
	
	bSizer71->Add( bSizer61, 3, wxEXPAND, 5 );
	
	panel_Options->SetSizer( bSizer71 );
	panel_Options->Layout();
	bSizer18->Add( panel_Options, 1, wxEXPAND | wxALL, 5 );
	
	bSizer7->Add( bSizer18, 0, wxEXPAND, 5 );
	
	this->SetSizer( bSizer7 );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrame::OnClose ) );
	this->Connect( menuItem_Exit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnExit ) );
	this->Connect( menuItem_Grid->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnGrid ) );
	this->Connect( menuItem_Follow->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnFollowMode ) );
	this->Connect( menuItem_ZoomIn->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnZoomIn ) );
	this->Connect( menuItem_ZoomOut->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnZoomOut ) );
	this->Connect( menuItem_Position->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnPosition ) );
	this->Connect( menuItem_Observation->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnObservationMode ) );
	this->Connect( menuItem_Manual->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnManual ) );
	this->Connect( menuItem_CoordDrive->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnCoordinateDrive ) );
	this->Connect( menuItem_PositionHistory->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnPositionHistory ) );
	this->Connect( menuItem_RangingHistory->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnRangingHistory ) );
	this->Connect( menuItem_Help->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnHelp ) );
	this->Connect( speedctrlSettings->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnSettings ) );
	button_MiniView->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnMiniview ), NULL, this );
	button_Help->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnHelp ), NULL, this );
	button_Options->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnOptions ), NULL, this );
	treeCtrl_Groups->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( MainFrame::OnMachineActivated ), NULL, this );
	treeCtrl_Groups->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( MainFrame::OnMachineSelected ), NULL, this );
	choice_Position->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnPositionChoice ), NULL, this );
	choice_Manual->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnManualChoice ), NULL, this );
	choice_CoordDrive->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnCoordChoice ), NULL, this );
	treeCtrl_Services->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( MainFrame::OnDeviceActivated ), NULL, this );
	treeCtrl_Services->Connect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( MainFrame::OnDeviceContextMenu ), NULL, this );
}

MainFrame::~MainFrame()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrame::OnClose ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnExit ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnGrid ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnFollowMode ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnZoomIn ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnZoomOut ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnPosition ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnObservationMode ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnManual ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnCoordinateDrive ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnPositionHistory ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnRangingHistory ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnHelp ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnSettings ) );
	button_MiniView->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnMiniview ), NULL, this );
	button_Help->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnHelp ), NULL, this );
	button_Options->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainFrame::OnOptions ), NULL, this );
	treeCtrl_Groups->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( MainFrame::OnMachineActivated ), NULL, this );
	treeCtrl_Groups->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( MainFrame::OnMachineSelected ), NULL, this );
	choice_Position->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnPositionChoice ), NULL, this );
	choice_Manual->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnManualChoice ), NULL, this );
	choice_CoordDrive->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainFrame::OnCoordChoice ), NULL, this );
	treeCtrl_Services->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( MainFrame::OnDeviceActivated ), NULL, this );
	treeCtrl_Services->Disconnect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( MainFrame::OnDeviceContextMenu ), NULL, this );
}

HelpFrame::HelpFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer8;
	bSizer8 = new wxBoxSizer( wxVERTICAL );
	
	m_textCtrl2 = new wxTextCtrl( this, wxID_ANY, wxT("MuRo help\n\n-Controls-\n\n-Selecting & view-\nTab, Shift+Tab - Switch selection between units.\nSpace - Center view to selected unit.\nEsc - Deselect.\nF5 - Toggle grid.\nF6 - Toggle follow mode. In follow mode view is fixed to currently selected unit.\nMove view by dragging with left button pressed and zoom with mouse wheel.\n\n-Driving-\nLeft and Right arrow - Steering.\nUp and down arrow - Drive forward and reverse.\nShift + arrows - Drive boost.\n\n-Position setting-\nF9 - Set selected units position.\nSelect position with pointer and orientation with mouse wheel.\nEsc - Cancel.\n"), wxDefaultPosition, wxDefaultSize, wxTE_CHARWRAP|wxTE_MULTILINE );
	bSizer8->Add( m_textCtrl2, 1, wxALL|wxEXPAND, 0 );
	
	this->SetSizer( bSizer8 );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( HelpFrame::OnClose ) );
}

HelpFrame::~HelpFrame()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( HelpFrame::OnClose ) );
}

_AlarmFrame::_AlarmFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer11;
	bSizer11 = new wxBoxSizer( wxVERTICAL );
	
	staticText_Header = new wxStaticText( this, wxID_ANY, wxT("Alarm type: alarm header"), wxDefaultPosition, wxDefaultSize, 0 );
	staticText_Header->Wrap( -1 );
	staticText_Header->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	
	bSizer11->Add( staticText_Header, 0, wxALL, 5 );
	
	staticText_Source = new wxStaticText( this, wxID_ANY, wxT("Source: source name"), wxDefaultPosition, wxDefaultSize, 0 );
	staticText_Source->Wrap( -1 );
	bSizer11->Add( staticText_Source, 0, wxALL, 5 );
	
	textCtrl_Message = new wxTextCtrl( this, wxID_ANY, wxT("Alarm text"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
	bSizer11->Add( textCtrl_Message, 1, wxEXPAND, 0 );
	
	wxBoxSizer* bSizer12;
	bSizer12 = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer12->Add( 0, 0, 1, wxEXPAND, 5 );
	
	button_Dismiss = new wxButton( this, wxID_ANY, wxT("Dismiss"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer12->Add( button_Dismiss, 0, wxALL, 5 );
	
	button_Close = new wxButton( this, wxID_ANY, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer12->Add( button_Close, 0, wxALL, 5 );
	
	
	bSizer12->Add( 0, 0, 1, wxEXPAND, 5 );
	
	bSizer11->Add( bSizer12, 0, wxEXPAND, 5 );
	
	this->SetSizer( bSizer11 );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( _AlarmFrame::OnClose ) );
	button_Dismiss->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _AlarmFrame::OnDismiss ), NULL, this );
	button_Close->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _AlarmFrame::OnCloseButton ), NULL, this );
}

_AlarmFrame::~_AlarmFrame()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( _AlarmFrame::OnClose ) );
	button_Dismiss->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _AlarmFrame::OnDismiss ), NULL, this );
	button_Close->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _AlarmFrame::OnCloseButton ), NULL, this );
}

_QuestionFrame::_QuestionFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer11;
	bSizer11 = new wxBoxSizer( wxVERTICAL );
	
	staticText_Header = new wxStaticText( this, wxID_ANY, wxT("Question: alarm header"), wxDefaultPosition, wxDefaultSize, 0 );
	staticText_Header->Wrap( -1 );
	staticText_Header->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	
	bSizer11->Add( staticText_Header, 0, wxALL, 5 );
	
	staticText_Source = new wxStaticText( this, wxID_ANY, wxT("Source: source name"), wxDefaultPosition, wxDefaultSize, 0 );
	staticText_Source->Wrap( -1 );
	bSizer11->Add( staticText_Source, 0, wxALL, 5 );
	
	textCtrl_Message = new wxTextCtrl( this, wxID_ANY, wxT("Alarm text"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
	bSizer11->Add( textCtrl_Message, 1, wxEXPAND, 0 );
	
	wxBoxSizer* bSizer12;
	bSizer12 = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer12->Add( 0, 0, 1, wxEXPAND, 5 );
	
	button_Yes = new wxButton( this, wxID_ANY, wxT("Yes"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer12->Add( button_Yes, 0, wxALL, 5 );
	
	button_No = new wxButton( this, wxID_ANY, wxT("No"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer12->Add( button_No, 0, wxALL, 5 );
	
	button_Close = new wxButton( this, wxID_ANY, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer12->Add( button_Close, 0, wxALL, 5 );
	
	
	bSizer12->Add( 0, 0, 1, wxEXPAND, 5 );
	
	bSizer11->Add( bSizer12, 0, wxEXPAND, 5 );
	
	this->SetSizer( bSizer11 );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( _QuestionFrame::OnClose ) );
	button_Yes->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _QuestionFrame::OnYes ), NULL, this );
	button_No->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _QuestionFrame::OnNo ), NULL, this );
	button_Close->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _QuestionFrame::OnCloseButton ), NULL, this );
}

_QuestionFrame::~_QuestionFrame()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( _QuestionFrame::OnClose ) );
	button_Yes->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _QuestionFrame::OnYes ), NULL, this );
	button_No->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _QuestionFrame::OnNo ), NULL, this );
	button_Close->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( _QuestionFrame::OnCloseButton ), NULL, this );
}

SettingsFrame::SettingsFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer17;
	bSizer17 = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer25;
	bSizer25 = new wxBoxSizer( wxHORIZONTAL );
	
	m_staticText16 = new wxStaticText( this, wxID_ANY, wxT("Speed scale"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText16->Wrap( -1 );
	bSizer25->Add( m_staticText16, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxLEFT, 5 );
	
	
	bSizer25->Add( 10, 0, 0, wxEXPAND, 5 );
	
	textCtrl_Speed = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer25->Add( textCtrl_Speed, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
	
	
	bSizer25->Add( 10, 0, 0, wxEXPAND, 5 );
	
	m_staticText171 = new wxStaticText( this, wxID_ANY, wxT("%"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText171->Wrap( -1 );
	bSizer25->Add( m_staticText171, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	bSizer17->Add( bSizer25, 1, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* bSizer26;
	bSizer26 = new wxBoxSizer( wxHORIZONTAL );
	
	m_staticText17 = new wxStaticText( this, wxID_ANY, wxT("Angular speed scale"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText17->Wrap( -1 );
	bSizer26->Add( m_staticText17, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxLEFT, 5 );
	
	
	bSizer26->Add( 10, 0, 0, wxEXPAND, 5 );
	
	textCtrl_AngularSpeed = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer26->Add( textCtrl_AngularSpeed, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
	
	
	bSizer26->Add( 10, 0, 0, wxEXPAND, 5 );
	
	m_staticText161 = new wxStaticText( this, wxID_ANY, wxT("%"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText161->Wrap( -1 );
	bSizer26->Add( m_staticText161, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	bSizer17->Add( bSizer26, 1, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* bSizer19;
	bSizer19 = new wxBoxSizer( wxHORIZONTAL );
	
	button_Save = new wxButton( this, wxID_ANY, wxT("Save"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer19->Add( button_Save, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
	
	button_Cancel = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer19->Add( button_Cancel, 0, wxALL, 5 );
	
	bSizer17->Add( bSizer19, 1, wxALIGN_RIGHT|wxALL, 5 );
	
	this->SetSizer( bSizer17 );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SettingsFrame::OnClose ) );
	button_Save->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SettingsFrame::OnSave ), NULL, this );
	button_Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SettingsFrame::OnCancel ), NULL, this );
}

SettingsFrame::~SettingsFrame()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SettingsFrame::OnClose ) );
	button_Save->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SettingsFrame::OnSave ), NULL, this );
	button_Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SettingsFrame::OnCancel ), NULL, this );
}
